package cn.bearspark.api.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * 枚举参数验证的注解
 *
 * @author f
 */
@Documented
@Constraint(validatedBy = EnumValidator.class)
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface Enumeration {

    /**
     * 枚举类
     */
    Class<? extends Enum<?>> value();

    String message() default "状态值异常";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
